package com.jk.admin.dao;

import com.jk.admin.entity.Coupon;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface CouponDao {

    @Select("select * from coupon")
    List<Coupon> query();

    @Delete("delete from coupon where coupon_id=#{id}")
    void delete(String id);

    @Update("update coupon set coupon_state=2 where coupon_id=#{id}")
    void overdueCoupon(String id);

    @Insert("insert into coupon values(#{coupon_id},#{coupon_describe},#{coupon_type},#{coupon_state},#{coupon_startDate},#{coupon_endDate},#{coupon_discount})")
    void insertCoupon(Coupon coupon);
}
